package ljl.alg.wangzheng_camp.round1.tree;

import commons.TreeNode;

public class _101_symmetric_tree {
    
    public boolean isSymmetric(TreeNode root) {
        return is(root, root);
    }
    boolean is(TreeNode left, TreeNode right) {
        if (left == null || right == null) return left == right;
        return left.val == right.val && is(left.left, right.right) && is(left.right, right.left);
    }
}
